/**
 * <b>项目名：</b>hclv-web<br/>  
 * <b>包名：</b>com.flea.hclv.service.impl<br/>  
 * <b>文件名：</b>HHotelServiceImpl.java<br/>  
 * <b>版本信息：</b>1.0<br/>  
 * <b>日期：</b>2018年9月12日 下午3:50:38<br/>  
 * <b>COPYRIGHT 2010-2012 ALL RIGHTS RESERVED 虫子科技</b>-版权所有<br/>
 */
package com.flea.hclv.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.flea.hclv.model.dao.HExplainMapper;
import com.flea.hclv.model.entity.HExplain;
import com.flea.hclv.service.HExplainService;

/**
 * @description
 * @createTime 2018年9月12日 下午3:50:38
 * @modifyTime
 * @author myflea@163.com
 * @version 1.0
 */
@Service("explainService")
public class HExplainServiceImpl implements HExplainService {
	@Autowired
	private HExplainMapper explainMapper;

	@Override
	public List<HExplain> getByProductId(String productId) {
		return explainMapper.selectByProductId(productId);
	}

	@Override
	public boolean save(List<HExplain> explains) {
		return explainMapper.insert(explains) > 0;
	}
	
	@Override
	public boolean update(HExplain explains) {
		return explainMapper.updateByPrimaryKey(explains) > 0;
	}

	@Override
	public boolean deleteByProductIds(String productIds, String userId) throws Exception {
		return explainMapper.deleteByProductIds(JSON.parseArray(productIds, String.class)) > 0;
	}


}
